﻿'Imports QLBH.GlobalClass
Imports DTO
Imports BUS
Imports System.Collections
Public Class frmNVChiTiet
    Private busNVien As New BUS.CBusiNhanVien()

 

    Private Sub frmNVChiTiet_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Dim tbNVien As DataTable
        'tbNVien = busNVien.DocBangNhanVien()
        'dgvDSNhanVien.DataSource = tbNVien
        ''txtMaNV.DataBindings.Add("Text", tbNVien, "maNV")
        ''txtHoTen.DataBindings.Add("Text", tbNVien, "hoTenNV")

    End Sub

   


    Private Function TaoNhanVien() As CNhanVien
        Dim newNV As CNhanVien = New CNhanVien()
        newNV.maNV = txtMaNV.Text
        newNV.hoTenNV = txtHoTen.Text
        newNV.ngaySinh = dtpNgaySinh.Value
        newNV.ngayVaoLam = dtpNgayVaoLam.Value
        newNV.gioiTinh = ""
        newNV.email = txtEmail.Text
        newNV.maLoaiNV = 2 ' xu lý combobox de nhan du lieu
        newNV.dienThoai = txtDienThoai.Text
        newNV.hinh = ""
        newNV.luong = 0
        newNV.tenDangNhap = txtMaNV.Text
        newNV.matKhau = txtMaNV.Text
        newNV.maQuyen = 1
        newNV.huyen = 3
        newNV.tinhTrang = 1
        newNV.tinh = 1
        newNV.ghiChu = txtGhiChu.Text
        newNV.chucVu = ""
        Return newNV

    End Function

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Dim newNV As CNhanVien = New CNhanVien(TaoNhanVien())
        busNVien.ThemSuaNhanVien(newNV, 1)
        Me.Close()
    End Sub

    Private Sub btnLuu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLuu.Click
        Dim newNV As CNhanVien = New CNhanVien(TaoNhanVien())
        busNVien.ThemSuaNhanVien(newNV, 1)
    End Sub
End Class